<template>
  <div class="system-menu-container">
    <div class="breadcrumb-box">
      <Breadcrumb />
    </div>
    <div class="page-main">
      <el-card shadow="hover" class="layout-padding-auto">
        <div class="system-user-search mb15">
          <el-input size="default" placeholder="准入记录-患者医生查询" style="max-width: 180px"> </el-input>
          <el-select size="default" placeholder="患者状态" style="max-width: 180px">
            <el-option label="成功" value="1"></el-option>
            <el-option label="失败" value="2"></el-option>
            <el-option label="其他" value="3"></el-option>
          </el-select>



          <el-date-picker size="default" type="date" placeholder="请选择" class="w100" style="max-width: 180px"> </el-date-picker>

          <el-button size="default" type="primary" class="ml10">
            <el-icon>
              <ele-Search />
            </el-icon>
            查询
          </el-button>
          <el-button size="default" type="" class="ml10">
            <el-icon>
              <ele-Refresh />
            </el-icon>
            重置
          </el-button>
        </div>
        <el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
          <el-table-column type="index" label="序号" width="60" />
          <el-table-column prop="name" label="准入记录名称" width="300" show-overflow-tooltip></el-table-column>
          <el-table-column prop="phone" label="准入负责人" show-overflow-tooltip></el-table-column>
          <el-table-column prop="op_name" label="准入评估报告" show-overflow-tooltip>
            <a style="color:blue">查看留档</a>
          </el-table-column>

          <el-table-column prop="op_time" label="患者状态" show-overflow-tooltip>
            <el-tag class="ml-2" type="success">已区</el-tag>

          </el-table-column>
          <el-table-column prop="artificial_count" label="准入时间" show-overflow-tooltip></el-table-column>

          <el-table-column label="操作" width="100">
            <template #default="scope">
              <el-button size="small" text type="primary" @click="onOpenEditDic('edit', scope.row)">查看</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
            @size-change="onHandleSizeChange"
            @current-change="onHandleCurrentChange"
            class="mt15"
            :pager-count="5"
            :page-sizes="[10, 20, 30]"
            v-model:current-page="state.tableData.param.pageNum"
            background
            v-model:page-size="state.tableData.param.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="state.tableData.total"
        >
        </el-pagination>
      </el-card>
    </div>
  </div>
</template>

<script setup name="qualityAssessment-manage-patient-index">
import { ElMessageBox, ElMessage } from 'element-plus';

// 引入组件
const Breadcrumb = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/breadcrumb.vue'));

// 定义变量内容
const state = reactive({
  tableData: {
    data: [],
    total: 0,
    loading: false,
    param: {
      pageNum: 1,
      pageSize: 10,
    },
  },
});

// 初始化表格数据
const getTableData = () => {
  state.tableData.loading = true;
  const data = [];
  for (let i = 0; i < 2; i++) {
    data.push({
      name: i === 0 ? '2023年02月16日-张三-日间手术中心准入' : '2023年02月13日-李四-日间手术中心准入',
      status:true,
      list: [],
    });
  }
  state.tableData.data = data;
  state.tableData.total = state.tableData.data.length;
  setTimeout(() => {
    state.tableData.loading = false;
  }, 500);
};

// 分页改变
const onHandleSizeChange = (val) => {
  state.tableData.param.pageSize = val;
  getTableData();
};
// 分页改变
const onHandleCurrentChange = (val) => {
  state.tableData.param.pageNum = val;
  getTableData();
};
// 页面加载时
onMounted(() => {
  getTableData();
});
</script>
